package com.cms.dao;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.cms.model.vo.SysRoleResource;

import tk.mybatis.mapper.common.Mapper;

public interface SysRoleResourceDao extends Mapper<SysRoleResource>{

	@Delete("delete from sys_role_resource where role_id in (${roleIds})")
	void deleteRoleResourceByRoleId(@Param("roleIds") String roleIds);
	
	@Delete("delete from sys_role_resource where resource_id in (${resIds})")
	void deleteRoleResourceByResId(@Param("resIds") String resIds);

	@Select("select role_res_id, role_id, resource_id, creator, create_time from sys_role_resource where role_id = #{roleId,jdbcType=INTEGER}")
	List<SysRoleResource> selectRoleResourceByRoleId(@Param("roleId") Integer roleId);
}
